import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {  OperaterQuery } from './types';

export const listOper = (query: any): AxiosPromise<[]> => {
  return request({
    url: '/system/user/listNew',
    method: 'get',
    params: query
  });
};

//重置密码
export const resetPwdNew = (data: any)=> {
  return request({
    url: '/system/user/resetPwdNew',
    method: 'put',
    headers: {
      isEncrypt: true
    },
    data: data
  });
};



//获取用户权限
export const userMenuTreeselect = (uid: any) => {
  return request({
    url: '/system/menu/userMenuTreeselect/'+uid,
    method: 'get'
  });
};



//添加
export const addOper = (data: any) => {
  return request({
    url: '/system/user/addNew',
    method: 'post',
    data: data
  });
};


//修改
export const updNew = (data: any) => {
  return request({
    url: '/system/user/updNew',
    method: 'put',
    data: data
  });
};



//修改
export const changeSt = (data: any) => {
  return request({
    url: '/system/user/changeSt',
    method: 'put',
    data: data
  });
};



//分配权限
export const configUserPer = (data: any) => {
  return request({
    url: '/system/user/cfgPer',
    method: 'post',
    data: data
  });
};




